function greeeter(person: Person) {
  return 'Hello, ' + person.name + ' ' + person.age
}
interface Person {
  name: string,
  age: number
}
let user = {name: 'lee', age: 26}
const div = document.createElement('div')
div.innerHTML = greeeter(user)
document.body.append(div)

// ts 类
class Student {
  fullName: string
  constructor (
    public firstName: string,
    public mid: string,
    public lastName: string) {
      this.fullName = firstName + mid + lastName
  }
}
interface Person1 {
  firstName: string
  lastName: string
}
var student = new Student('Jane', 'M.', 'User') // student 属于 Person1 类，因为包含着 Person1 类的结构
function greeter (person: Person1) {
  return person.firstName + ' ' + person.lastName
}
const name2 = greeter(student)
console.log('name2', name2)
